<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Dressing page</title>
    </head>
    <body>
        <h1>编辑 Dressing page</h1>
        <form:form method="post" modelAttribute="dressing" enctype="multipart/form-data" 
                   action="${pageContext.request.contextPath}/dressings/${dressing.id}/update" >
            <table>
                <tbody>
                    
                    <tr>
                        <td>Dressing Title:</td>
                        <td><form:input path="title"  /></td>
                        <td><form:errors path="title" cssStyle="color: red;"/></td>
                    </tr>
                    <tr>
                        <td>Dressing picture:</td>
                        <td><input type="file" name="picture" /></td>
                    </tr>
                    <tr>
                        <td>当前图片</td>
                        <td><img src="${pageContext.request.contextPath}/pictures/${dressing.id}" /></td>
                        <td></td>
                    </tr>
                    <tr>
                        
                        <td>Caption</td>
                        <td><form:input path="caption" /></td>
                        <td><form:errors path="caption" cssStyle="color: red;"/></td>
                    </tr>
                    <tr>
                        <td><input type="submit" value="更新" /></td>
                        <td></td>
                        <td></td>
                    </tr>
                </tbody>
            </table>
        </form:form>
        <a href="${pageContext.request.contextPath}/">主页</a>
    </body>
</html>